package spring_introduction;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ConfigWithAnnotation1 {

    public static void main(String[] args) {
        try (
                ClassPathXmlApplicationContext context =
                        new ClassPathXmlApplicationContext("applicationContext3.xml")
                ) {
            // default id for bean - Class name is Cat --> bean id is cat
//            Cat myCat = context.getBean("cat", Cat.class);
//            myCat.say();

            Person person = context.getBean("personBean", Person.class);
            person.callYourPet();

            System.out.println(person.getSurname());
            System.out.println(person.getAge());


        }
    }
}
